<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .search {
            margin: 100px;
            width: 200px;
        }
        
        .con {
            position: relative;
            font-size: 18px;
            border: 1px solid #ccc;
            box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
            margin-bottom: 5px;
            visibility: hidden;
        }
        
        .con::before {
            content: '';
            top: 24px;
            left: 18px;
            position: absolute;
            border: 8px solid #000;
            border-color: white transparent transparent;
        }
    </style>
</head>

<body>
    <div class="search">
        <div class="con">123</div>
        <input type="text" placeholder="请输入快递单号">
    </div>
    <script>
        const con = document.querySelector('.con')
        const ipt = document.querySelector('input')
        ipt.onkeyup = function(e) {
            if (this.value == '') {
                con.style.visibility = 'hidden'
            } else {
                con.style.visibility = 'visible'
                con.innerHTML = this.value
            }
        }
    </script>
</body>

</html>